/*User program on Nachos
  For project 4
*/

/*Author: Yuzhe Wu 4/14*/


#include "syscall.h"
#include "user.h"
#include "create.h"
#include "doctorOffice.h"



void main() {

	int patientNumLocal;
	int i = 0;
	myMV patientNum = -1;
	
	Printf("Please enter the number of Patients(1 to 50)\n");
	patientNumLocal = InputInt();
	while ( !(patientNumLocal>=1&&patientNumLocal<=50)){ 
		Printf("You must input an Integer(1 to 50)\n");
		Printf("Please reenter the number of Patients(1 to 50)\n");
		patientNumLocal = InputInt();			
	}

	patientNum = rpcCreateMV("PNum",sizeof("PNum"),1,0);
	rpcSetValueMV(patientNum,0,patientNumLocal);
	
	for(i=0; i < patientNumLocal; i++){
		Exec("../test/patient",sizeof("../test/patient"));
		delay();
	}
	Exit(0);

}